Mysqldump create empty sql file? [php & mysql on Windows]
Posted
by mysqllearner
on Stack Overflow
See other posts from Stack Overflow
or by mysqllearner
Published on 2010-01-14T03:12:37Z
Indexed on
2010/05/29
5:12 UTC
Read the original article
Hit count: 259
Hi all,
I tried to dump a database:
<?php
$dbhost = "localhost";
$dbuser = "XXXX";
$dbpass = "XXXXXXXX";
$dbname = 'testdb';
$list = shell_exec ("C:\wamp\bin\mysql\mysql5.1.33\bin\mysqldump.exe $dbname --user=$dbuser--password=$dbpass > dumpfile.sql");
?>
I tried both specified full path to mysqldump.exe or just use mysqldump, it still give me a 0kb dumpfile.sql
Details: Programming Language: PHP Database: MySql 5.XX OS(server): Windows Server 2003. (currently testing on Windows Vista machine)
EDIT @ Jeremy Heslop:
I tried:
shell_exec("C:\wamp\bin\mysql\mysql5.1.33\bin\mysqldump.exe --opt -h $dbhost -u$dbuser -p$dbpass $dbname > test.sql");
safe_mode = off
Still no luck man.
© Stack Overflow or respective owner